import { useParams, useSearchParams } from "react-router-dom";
const Article = () => {
  const [searchParams] = useSearchParams();
  const id = searchParams.get('id');

  const {id: cId} = useParams();

  return (
  <>
    <div>searchParams 传参</div>
    <p>id: {id}</p>
    <hr />
    <p>userParams 传参</p>
    <p>id: {cId}</p>
  </>
);
};

export default Article;